package cn.gok.homework;
import java.security.SecureRandom;
import java.util.Random;
import java.util.Scanner;

public class day01_homework {
    public static final String str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";

    public static final String num = "0123456789";

    private static char getChar(String str){
        SecureRandom random = new SecureRandom();
        return str.charAt(random.nextInt(str.length()));
    }

    private  static char getUpChar(){
        return getChar(str);
    }

    private static char getNumChar(){
        return getChar(num);
    }

    public static void main(String[] args) {

        System.out.println("请输入大于6位的密码");
        String pwd = "";
        Random r = new Random();
        int n = new Scanner(System.in).nextInt();
        for (int i=0;i<n;i++){
            int j = r.nextInt(2);
            switch (j){
                case 0:
                    pwd += getUpChar();break;
                case 1:
                    pwd +=getNumChar();break;
            }

        }


        System.out.println("密码"+pwd);

    }
}
